<extend name="Public/base"/>

<block name="body">
	<!-- 标题栏 -->
	<div class="main-title">
		<h2>回收站商品列表</h2>

	</div>
    <div class="tools">
        <a class="btn" href="javascript:history.back(-1);">返 回</a>
        
        <!-- 高级搜索 -->
		<div class="search-form fr cf">
			<div class="sleft">
				<input type="text" name="title" class="search-input" value="{:I('title')}" placeholder="请输入商品名称">
				<a class="sch-btn" href="javascript:;" id="search" url="{:U('Goods/recycle')}"><i class="btn-search"></i></a>
			</div>
		</div>
    </div>

	<!-- 数据列表 -->
	<div class="data-table">
        <div class="data-table table-striped">
<table class="">
    <thead>
        <tr>
		<th class="">编号</th>
        <th>图像</th>
		<th class="">名称</th>
        <th class="">价格</th>
		<th class="">库存</th>
        <th class="">描述</th>
		<th class="">操作</th>
		</tr>
    </thead>
    <tbody>
	<notempty name="_list">
		<volist name="_list" id="vo">
		<tr>
			<td>{$vo.id} </td>
            <td><img src="{$vo['cover_id']|get_cover='path'}" width="60"/></td>
			<td>{$vo.title}</td>
            <td>{$vo.price}</td>
            <td>{$vo.stock}</td>
			<td>{$vo.description}</td>
			<td>
				<a href="{:U('Goods/edit', 'id='.$vo['id'])}">编辑</a>
                <a href="{:U('Goods/setstatus?ids='.$vo['id'].'&status='.abs(1-$vo['status']))}" class="ajax-get">{$vo.status|show_goods_status_op}</a>
                <a class="confirm ajax-get" href="{:U('Goods/setStatus', 'status=1&ids='.$vo['id'])}">上架</a>
            </td>
		</tr>
		</volist>
		<else/>
		<td colspan="7" class="text-center"> aOh! 暂时还没有内容! </td>
		</notempty>
	</tbody>
    </table>

        </div>
    </div>
    <div class="page">
        {$_page}
    </div>
</block>

<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>
    <script type="text/javascript">
  //搜索功能
	$("#search").click(function(){
		var url = $(this).attr('url');
		//var status = $("#sch-sort-txt").attr("data");
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
		if(status != ''){
			query = 'status=' + status + "&" + query;
        }
        if( url.indexOf('?')>0 ){
            url += '&' + query;
        }else{
            url += '?' + query;
        }
		window.location.href = url;
	});
 //回车自动提交
    $('.search-form').find('input').keyup(function(event){
        if(event.keyCode===13){
            $("#search").click();
        }
    });
    //导航高亮
    highlight_subnav('{:U('Goods/recycle')}');
</script>
</block>
